package _5_Create._5_1_Factory._5_1_2_Singleton;

/**
 * 懒汉单例模式,不怎么好，加锁-慢，实例不是final-线程不安全
 */
public class LazySingleton {
    private static LazySingleton m_instance = null;

    private LazySingleton() {
    }

    synchronized public static LazySingleton getInstance() {
        if (m_instance == null) {
            m_instance = new LazySingleton();
        }

        return m_instance;
    }
}
